<?php
$this->breadcrumbs=array(
	'Polos'=>array('index'),
	'Gerenciar',
);

$this->menu=array(
	array('label'=>'Listar Polos', 'url'=>array('index')),
	array('label'=>'Novo Polo', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('cad-polo-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php 
// echo CHtml::link('Busca Avançada','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php
// $this->renderPartial('_search',array(
//	'model'=>$model,
//)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'cad-polo-grid',
        'pager' => array('cssFile' => Yii::app()->baseUrl . '/themes/'.Yii::app()->theme->name.'/gridView.css'),
        'cssFile' => Yii::app()->baseUrl . '/themes/'.Yii::app()->theme->name.'/css/gridView.css',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(		
                array(
                       'name'=>'cod_polo',
                       'type'=>'raw',
                       'value'=>'cad_polo::loadTablePolo($data->cod_polo)'
                    ),            		
                array(
                       'name'=>'cod_gestor',
                       'type'=>'raw',
                       'value'=>'cad_gestor::loadTableGestor($data->cod_gestor)'
                    ),               
                array(
                       'name'=>'cod_parceiros',
                       'type'=>'raw',
                       'value'=>'cad_parceiros::loadTableParceiro($data->cod_parceiros)'
                    ),               
		'nome_fantazia',
		'diretoria_ensino',
		'habitantes',
		/*
		'logradouro',
		'numero',
		'complemento',
		'bairro',
		'cidade',
		'cep',
		'estado',
		'telefone',
		'e_mail',
		'responsavel',
		*/
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
